$(function() {
	$.ajax({
		type: "post",
		url: "php/downData.php",
		data: $.param({
			user: $.cookie('username')
		}),
		success: function(data, stutas, xhr) {
			var json = $.parseJSON(data);
			if(json.length != 0) {
				$.each(json, function(index, element) {
					share().createDivDown({
						id: element.id,
						style: element.style,
						src: element.src,
						href: element.href,
						xzdz:element.xzdz
					}, $('.content'));
				});
				share().lanLoad($('.jianli_div_img'), $('.main')); //图片懒加载
				$('#loading_img').css('display', 'none');
				$('.jianli_div_bottom_a').on('click',function(){
					 plus.runtime.openFile($(this).attr('xzdz'),{},function(e) {
	 	                 alert("此文件已删除，重新下载!")
                         openfalse($(this).attr('xzdz'),$(this).attr('xhref'));
                     });
				})
			} else {
				$('.tupian').css('display', 'block');
			}
		}
	});
		document.addEventListener('plusready', function() {
		//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
		plus.key.addEventListener('backbutton', function() {
			//					plus.runtime.quit();
		    		if($('#content').is(':hidden'))
			{
				$('#content').css('display','block');
				$('#pinglun').css('display','none');
			}
			else{
			 history.back();	
			}
		});
	});
})